//
//  WishNumberViewController.m
//  一点互助
//
//  Created by 张泊秋 on 16/8/24.
//  Copyright © 2016年 zhangboqiu. All rights reserved.
//

#import "WishNumberViewController.h"
#import "ResponseManager.h"
#import "ResponseManager+Wishnumber.h"
#import "WishView.h"

@interface WishNumberViewController ()

@property (nonatomic,strong)NSDictionary *dataSource;
@property (nonatomic ,strong)WishView *wishView;

@end

@implementation WishNumberViewController


- (void)viewWillAppear:(BOOL)animated {
    [ResponseManager getWishNumbersCompletionHandler:^(FBResponse *response) {
        if (response.success) {
            self.dataSource = response.resultValue;
            NSLog(@"%@",self.dataSource);
            _wishView.number.text = self.dataSource[@"num"];
            _wishView.rule.text = self.dataSource[@"desc"];
        }else {
            
        }
        
    }];
    self.tabBarController.tabBar.hidden = YES;

}

- (void)viewWillDisappear:(BOOL)animated {
    self.tabBarController.tabBar.hidden = NO;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self setupBackItem];
    self.title = @"愿望次数";
    [self setUpView];
 
    
    
}

- (void)setUpView {
    
    self.wishView = [WishView loadMyHeaderView];
    _wishView.frame = CGRectMake(0, 64, kScreenWidth, 300 *kScreenHeightScale);
    [self.view addSubview:_wishView];
    
}




- (NSDictionary *)dataSource {
    if (!_dataSource) {
        _dataSource = [NSDictionary dictionary];
    }
    return _dataSource;
}



@end
